package config

import (
	"fileserver/logger"
	"gopkg.in/yaml.v2"
	"io/ioutil"
)

func LoadFromYaml(cfg string) {
	data, err := ioutil.ReadFile(cfg)
	if err != nil {
		logger.Warn("Read yaml file [%s] error: %v", cfg, err)
	}
	err = yaml.Unmarshal(data, Config)
	if err != nil {
		logger.Warn("Yaml config [%s] error: %v", cfg, err)
	}
}
